<%--
  Created by IntelliJ IDEA.
  User: dong_
  Date: 2021/10/14
  Time: 13:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zxx">

<head>
    <title>login</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/css/style.css" type="text/css" media="all" />
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#btn").click(function () {
                if ($("#pas").val()!=$("#npas").val()){
                    $("p.signuplink").text("两次密码不一致");
                    return false
                }
                if ($("#img").val()==null||$("#img").val()==""){
                    $("p.signuplink").text("头像不能为空");
                    return false
                }
                if ($("#phone").val().length!=11){
                    $("p.signuplink").text("电话号格式不正确");
                    return false
                }
                $("p.signuplink").text("");
            })
        })
    </script>
</head>
<body>
<section class="w3l-login">
    <div class="overlay">
        <div class="wrapper">
            <div class="form-section">
                <h3>注册</h3>
                <h6>注册就能登录</h6>
                <form action="${pageContext.request.contextPath }/user/regist" method="post" class="signin-form"  enctype="multipart/form-data">
                    <div class="form-input">
                        <input type="text" name="name" placeholder="用户名" required="" autofocus>
                    </div>
                    <div class="form-input">
                        <input type="password" name="password" id="pas" placeholder="密码" required="">
                    </div>
                    <div class="form-input">
                        <input type="password" name="newp" id="npas" placeholder="再次输入密码" required="">
                    </div>
                    <div class="form-input">
                        <input type="text" name="phone" id="phone" placeholder="电话" required="">
                    </div>
                    <div>头像</div>
                    <div class="form-input">

                        <input type="file" name="src" id="img">
                    </div>
                    <button type="submit" class="btn btn-primary theme-button mt-4" id="btn">注册</button>
                    <div class="new-signup">
                        <p name="msg" class="signuplink" style="color: red">${requestScope.msg}</p>
                    </div>
                </form>
                <p class="signup">已有账户? <a href="/index.jsp" class="signuplink">登录</a></p>
            </div>
        </div>
    </div>
    <div id='stars'></div>
    <div id='stars2'></div>
    <div id='stars3'></div>

    <!-- copyright -->
    <div class="copy-right">
        <p>&copy;版权所有Java2103王浩 <a href="http://w3layouts.com/" target="_blank">W3Layouts</a></p>
    </div>
    <!-- //copyright -->
</section>

<!-- /login form -->
</body>

</html>
